<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${initParam.root }jquery-1.9.1.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#deleteMessageBtn").click(function(){
			var c=confirm("정말로 삭제할껍니까?");
			if(c){
			$.ajax({
				type:"post",
				url:"${initParam.root}message.do",
				dataType:"json",
				data:$("#deleteMessageForm").serialize(),
				success:function(result){
					alert("삭제완료");
					location.href="${initParam.root}message.do?command=messageBox&pageRe=1&pageSd=1";
				}
			});
			}//if
			else
				return false;
		});
	});
</script>
</head>
<body>
<h3>쪽지 상세보기</h3><br>

보낸사람ID: ${requestScope.result.senderId } | 보낸시간: ${requestScope.result.send_date }<br>
<textarea rows="25" cols="90" readonly="readonly">${requestScope.result.content }</textarea>
<br>
<a href="${initParam.root }message.do?command=messageBox&pageRe=1&pageSd=1">목록보기</a>

<form action="${initParam.root }message.do" id="deleteMessageForm" method="post">
<input type="button" value="삭제" id="deleteMessageBtn">
<input type="hidden" name="command" value="deleteMessage">
<input type="hidden" name="no" value="${requestScope.result.no }">
</form>
</body>
</html>

